package beanstao.util.store.common;

public enum StatusType
{
	/**
	 * 正常状态
	 */
	Normal(0),
	/**
	 * 错误状态
	 */
	Error(1), QueZhi(2);

	private int intValue = 1;

	StatusType(int value)
	{
		intValue = value;
	}

	public static StatusType parse(String value)
	{
		int i = 1;
		try
		{
			i = Integer.parseInt(value);
		}
		catch (Exception e)
		{
		}
		return parse(i);
	}

	public static StatusType parse(int value)
	{
		switch (value)
		{
			case 2:
				return QueZhi;
			case 1:
				return Error;
			case 0:
			default:
				return Normal;
		}
	}

	@Override
	public String toString()
	{
		return String.valueOf(intValue);
	}
}
